

interface Person {
    id: number,
    name: string
}

function parse() {
    let jsonObj = '{"id": 1, "name":"Levi"}'

    const p1: Person = JSON.parse(jsonObj)
    console.log(p1)
}

function stringify() {
    let p1: Person = {
        id: 1,
        name: "ABC"
    }

    const jsonObj = JSON.stringify(p1)
    console.log(jsonObj)
}

export default function test_json() {
    console.log("===> test_json()")
    parse()
    console.log("----------------------------")
    stringify()
}